package com.ruoyi.qywx.service.inters;

import com.ruoyi.common.core.cache.Meta;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.qywx.callback.txl.ExtChatEncrypt;
import com.ruoyi.qywx.entity.ExtGroupChat;
import com.ruoyi.qywx.entity.ExtGroupChatMember;
import com.ruoyi.qywx.model.query.GroupChatQuery;
import com.ruoyi.qywx.model.vo.GroupChatManagerVo;

import java.util.List;

/**
 * @author : hcl
 * @Date : 2023/9/7 10:53
 */
public interface ExtGroupChatService {
    /**
     * 群列表数据
     */
    List<GroupChatManagerVo> groupChatList(Long teamId, GroupChatQuery query);

    /**
     * 群详情
     */
    AjaxResult groupChatDetail(Long teamId, Long groupChatId);

    /**
     * 群绑定标签
     *
     * @param ids    群ids
     * @param tagIds 标签ids
     */
    AjaxResult groupChatBindTags(Long teamId, List<Long> ids, List<Long> tagIds);

    /**
     * 微信回调创建群事件
     */
    void informCreateChat(Meta meta, String chatId);

    void insertGroupChat(ExtGroupChat chat);

    void insertGroupChatMembers(List<ExtGroupChatMember> members);

    void addMember(Meta meta, ExtChatEncrypt encrypt);

    List<ExtGroupChatMember> findChatMembersByChatWxId(Long teamId, String chatWxId, boolean includeDelete);

    void deleteMember(Meta meta, ExtChatEncrypt encrypt);

    /**
     * @param changeType notice 变更群公告，name 变更群昵称，owner 变更群主
     */
    void changeChatInfo(Meta meta, ExtChatEncrypt encrypt, String changeType);

    List<ExtGroupChatMember> groupChatMembers(Long teamId, Long chatId, String nickName, Boolean isDelete);
}
